import { useRequest } from 'ahooks';
import { useState } from 'react'
import request from "../../../utils/request";
function useCommentData() {
    const getCommentDataApi = params => request({ url: '/comment/query',data: params})
    const [ commentData,setCommentData ] = useState([])
    const { loading, run } = useRequest(getCommentDataApi, {
        manual: true,
        onSuccess: res => {
            setCommentData(res.data)
        },
    })
    const getData = params => {
        run(params)
    }
    return {
        loading,
        getData,
        commentData
    }
}

export default useCommentData
